<!DOCTYPE html>
<html lang='en'>
<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script type='text/javascript' src='js/vue.js'></script>
</head>
<body>
    <div id='app'>
        {{msg}}
        <p>{{msg | aa}}</p>
        <p>{{ msg | bb('世界') }}</p>
    </div>
    <script type='text/javascript'>
        // 自定义全局过滤器
        Vue.filter('aa',function(str){
            return str.replace('Hello','你好')
        })
        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'Hello Vue'
            },
            methods: {},
            filters: {
                bb(str,para) {
                    return str.replace('Hello','你好'+para)
                }
            }
        });
    </script>
</body>
</html>